package com.itheima.homework9;

import java.util.HashSet;

/*
	1. HashSet：存储学生对象并且遍历（主要是hashCode 和 equals）
 */
public class Test1 {
    public static void main(String[] args) {
        HashSet<Student> hs=new HashSet<>();
        hs.add(new Student("张三",23));
        hs.add(new Student("李四",24));
        hs.add(new Student("王五",26));
        hs.add(new Student("钱七",28));
        hs.forEach(stu-> System.out.println(stu));

    }
}
